//
//  helloWorldViewController.m
//

#import "helloWorldViewController.h"

@implementation helloWorldViewController

- (void)updateTimeLabel {
	NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
	
	if (dateSwitch.on) {
		[dateFormatter setDateFormat:@"dd-MMM-yyy, hh:mm:ss"];
	} else {
		[dateFormatter setDateFormat:@"hh:mm:ss"];
	}
	
	labelTime.text = [dateFormatter stringFromDate:[NSDate date]];
	labelTime.font = [UIFont systemFontOfSize:fontSlider.value];
	[dateFormatter release];
}

- (IBAction)controlChanged:(id)sender {
	[self updateTimeLabel];
}

- (void)viewDidLoad {
	[super viewDidLoad];
	[self updateTimeLabel];
}

@end
